<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    h1 {
        height: 80px;
        position: sticky;
        top: 0;
        background-color: beige;
        box-shadow: 12px 9px 6px 4px #b8b2aa;
        ;
    }

    main {
        /* display: flex; */
        /* y表示贴合方式  mandatory强制滚动 proximity滚动到一定距离才会贴合*/
        scroll-snap-type: y mandatory;
        scroll-padding: 80px;
        overflow: scroll;
        /* width: 100vw; */
        height: 100vh;
    }

    section {
        /* width: 100vw; */
        height: 100vh;
        scroll-snap-align: center;
        border: 1px solid black;
        /* flex-shrink: 0; */
        text-align: center;
        line-height: 100vh;
    }

    section:nth-child(2n+1) {
        background-color: rgb(172, 179, 172);
    }
</style>

<body>
    <main>
        <h1>标题</h1>
        <section>页面内容一</section>
        <section>页面内容二</section>
        <section>页面内容三</section>
        <section>页面内容四</section>
    </main>
</body>

</html>